<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        const date = new Date()
        console.log(date);//打印的是此时此刻的时间
        console.log(date.getMonth() + 1);//因为从0开始
        const date1 = new Date('2023-11-3 8:40:00')
        console.log(date1);
    </script>
</body>

</html>